package com.asiainfo.dacp.datastash.orm.dao.core;

import com.asiainfo.dacp.datastash.orm.po.core.DataStashUnitStepPo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by winter on 2017/10/31.
 */
@Repository
public interface DataStashUnitStepDao extends JpaRepository<DataStashUnitStepPo,String>,JpaSpecificationExecutor<DataStashUnitStepPo> {


    @Query("select p from DataStashUnitStepPo p where p.unitId=:unitId ")
    public List<DataStashUnitStepPo> findListByUnitId(@Param("unitId") String unitId );

    @Modifying
    @Query(value="delete from DataStashUnitStepPo p where  p.unitId=:unitId")
    public	int deleteByUnitId(@Param("unitId") String unitId);

}

